package com.zark.myspringboot.web.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.PathVariable;

import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PutMapping;
import com.zark.myspringboot.biz.common.bo.OperLogBo;
import com.zark.myspringboot.entity.common.module.OperLogDo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("operLog")
public class OperLogController {

	@Resource
	private OperLogBo operLogBo;

	@GetMapping(value = "queryAll")
	public List<OperLogDo> queryAll() {
		return operLogBo.queryAll();
	}

	@PostMapping(value = "addOperLog")
	public void addOperLog(OperLogDo operLogDo) {
		operLogBo.addOperLog(operLogDo);
	}

	@DeleteMapping(value = "deleteById/{id}")
	public void deleteById(@PathVariable(name = "id") Long id) {
		operLogBo.deleteById(id);
	}

	@PutMapping(value = "updateOperLog")
	public void updateOperLog(OperLogDo operLogDo) {
		operLogBo.updateOperLog(operLogDo);
	}

	@GetMapping(value = "queryById/{id}")
	public OperLogDo queryById(@PathVariable(name = "id") Long id) {
		return operLogBo.queryById(id);
	}
}
